home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 026a / strdct.zip / STRDCT.MDX (.txt) < prev    next >
dBASE Multiple Index  |  1991-01-24  |  10KB  |  248 lines

  1. STRDCT
  2.                         case 'I' : nocase=1;
  3.                                    break;
  4.                         case 'd' :
  5.                         case 'D' : descend=1;
  6.                                    break;
  7.                         case 'f' :
  8.                         case 'F' : dofast=1;
  9.                                    break;
  10.                         case 'o' :
  11.             case 'O' : output = &argv[i][2];
  12.                    break;
  13.                         default
  14. STRDCTIA
  15. STRDCTID
  16. STRDCTCA
  17. STRDCTCD
  18.      if (!strrchr(filename,'.') ||
  19.        strrchr(filename,'.')<strrchr(filename,'\\'))
  20.      strcat(filename,".SO");
  21.      if (!(fp=fopen(filename,"rb")))
  22.         hferror("Unable to open sort order file -> ",filename,0);
  23.      if (output) /* We we open up output file ?*/
  24.        if (!(ofp=fopen(output,"wt")))
  25.           hferror("Unable to open output file -> ",output,0);
  26. /* If we don't care about case then read the first helf of the file */
  27.      if (fseek(fp,(long)(nocase ? 8-fw2:264-fw2),SEEK_SET))
  28.         hferror("Unable to seek in -> ",filename,0);
  29.      if (fread(buffer,sizeof(char),256,fp) < 256)
  30.         hferror("Unable to read character data from -> ",filename,0);
  31.      fprintf(ofp,"\t/* Read from %s (Framework %s)\n" \
  32.                  "\t   Table is case %s \n" \
  33.                  "\t   Table is in %s order */\n",
  34.             filename,
  35.             fw2 ? "II":"III",
  36.             nocase ? "insensitive":"sensitive",
  37.             descend ? "descending":"ascending");
  38.      if (dofast)
  39.         fprintf(ofp,"\tstatic unsigned char trnslt[256]={\n");
  40.      else
  41.         fprintf(ofp,"\tstatic unsigned char trnslt[256];\n");
  42. /* Write out our table with four assignments per line */
  43.      for(i=0;i<256;i++) {
  44.        if (!(i % (4 + (dofast ? 8:0))))  /* Print four/16 per line */
  45.          fprintf(ofp,"\n\t");
  46.        if (!dof
  47. CALL("strdctia",testfield+"")
  48. 7l    
  49. l7    
  50. CALL("strdctid",testfield+"")
  51. 7l    
  52. CALL("strdctca",testfield+"")
  53. 7l    
  54. k    
  55. CALL("strdctcd",testfield+"")
  56. 7l    
  57. 7l    i
  58. 7l    
  59. l7    
  60. l7    ~r
  61. cept:
  62. l:ESC
  63. key...
  64. key...
  65. key...
  66. rol: SPACEBAR:Nex    sc
  67. enful
  68.  RETURN:St
  69.  scroll.
  70. Proceed
  71. kept.
  72. key...
  73. Wildc
  74. key...
  75. File]
  76. to itself
  77. to itself
  78. to itself
  79. es/di
  80. a~ on.
  81. key...
  82. n ign
  83. key...
  84. :Execu~
  85. ESC:Ab
  86. :Se     Ctrl_End:Co
  87. ESC:Ab
  88. key...
  89. disk di
  90. wait...
  91. augh~r.
  92. key...
  93. too long
  94. key...
  95. key...
  96. on di
  97. key...
  98. nied.
  99. key...
  100. doesn'    
  101. key...
  102. key...
  103. faul    driv
  104. saved
  105.  driv
  106.  Shift-F1 PICK
  107. cept:
  108. l:ESC
  109. key...
  110. key...
  111. key...
  112. rol: SPACEBAR:Nex    sc
  113. enful
  114.  RETURN:St
  115.  scroll.
  116. Proceed
  117. kept.
  118. key...
  119. Wildc
  120. key...
  121. File]
  122. to itself
  123. to itself
  124. to itself
  125. es/di
  126. a~ on.
  127. key...
  128. n ign
  129. key...
  130. :Execu~
  131. ESC:Ab
  132. :Se     Ctrl_End:Co
  133. ESC:Ab
  134. key...
  135. disk di
  136. wait...
  137. augh~r.
  138. key...
  139. too long
  140. key...
  141. key...
  142. on di
  143. key...
  144. nied.
  145. key...
  146. doesn'    
  147. key...
  148. key...
  149. faul    driv
  150. saved
  151.  driv
  152.  Shift-F1 PICK
  153.     i
  154. 7    
  155. k    ~r
  156. cept:
  157. l:ESC
  158. key...
  159. key...
  160. key...
  161. rol: SPACEBAR:Nex    sc
  162. enful
  163.  RETURN:St
  164.  scroll.
  165. Proceed
  166. kept.
  167. key...
  168. Wildc
  169. key...
  170. File]
  171. to itself
  172. to itself
  173. to itself
  174. es/di
  175. a~ on.
  176. key...
  177. n ign
  178. key...
  179. :Execu~
  180. ESC:Ab
  181. :Se     Ctrl_End:Co
  182. ESC:Ab
  183. key...
  184. disk di
  185. wait...
  186. augh~r.
  187. key...
  188. too long
  189. key...
  190. key...
  191. on di
  192. key...
  193. nied.
  194. key...
  195. doesn'    
  196. key...
  197. key...
  198. faul    driv
  199. saved
  200.  driv
  201.  Shift-F1 PICK
  202. cept:
  203. l:ESC
  204. key...
  205. key...
  206. key...
  207. rol: SPACEBAR:Nex    sc
  208. enful
  209.  RETURN:St
  210.  scroll.
  211. Proceed
  212. kept.
  213. key...
  214. Wildc
  215. key...
  216. File]
  217. to itself
  218. to itself
  219. to itself
  220. es/di
  221. a~ on.
  222. key...
  223. n ign
  224. key...
  225. :Execu~
  226. ESC:Ab
  227. :Se     Ctrl_End:Co
  228. ESC:Ab
  229. key...
  230. disk di
  231. wait...
  232. augh~r.
  233. key...
  234. too long
  235. key...
  236. key...
  237. on di
  238. key...
  239. nied.
  240. key...
  241. doesn'    
  242. key...
  243. key...
  244. faul    driv
  245. saved
  246.  driv
  247.  Shift-F1 PICK
  248.